package com.example.condition;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

import java.util.Date;

@Configuration
//根据此条件决定是否返回对象
@Conditional(value = MyCondition.class)
public class MyConf {
    @Bean
    public Date date(){
        return new Date(100,1,1);
    }
}
